package jm.coll.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @Description 迭代器演示
 * @date 2022/3/30 17:23
 */
public class TestIterator {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for (int i = 1; i <= 100; i++) {
            list.add(i);
        }
        Iterator<Integer> iterator = list.iterator();
         while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
